Merge pull request #310 from public-awesome/authz-update

Authz update
This commit is contained in:
Serkan Reis 2024-01-17 12:27:15 +02:00 committed by GitHub
commit a4b114e01d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 1001 additions and 262 deletions

View File

@ -1,4 +1,4 @@
APP_VERSION=0.8.5
APP_VERSION=0.8.7
NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS
NEXT_PUBLIC_SG721_CODE_ID=2595

View File

@ -158,3 +158,16 @@ export const royaltyRegistryLinkTabs: LinkTabProps[] = [
href: '/contracts/royaltyRegistry/execute',
},
]
export const authzLinkTabs: LinkTabProps[] = [
{
title: 'Grant',
description: `Grant authorizations to a given address`,
href: '/authz/grant',
},
{
title: 'Revoke',
description: `Revoke already granted authorizations`,
href: '/authz/revoke',
},
]

View File

@ -45,7 +45,7 @@ export const Sidebar = () => {
}, [])
const handleResize = () => {
setIsTallWindow(window.innerHeight > 700)
setIsTallWindow(window.innerHeight > 768)
}
useEffect(() => {
@ -67,7 +67,7 @@ export const Sidebar = () => {
{/* main navigation routes */}
<div className={clsx('absolute left-[5%] mt-2', isTallWindow ? 'top-[20%]' : 'top-[30%]')}>
<ul className="group p-2 w-full bg-transparent menu rounded-box">
<ul className="group py-1 px-2 w-full bg-transparent menu rounded-box">
<li tabIndex={0}>
<div
className={clsx(
@ -131,7 +131,7 @@ export const Sidebar = () => {
</li>
</ul>
<Conditional test={BADGE_HUB_ADDRESS !== undefined}>
<ul className="group p-2 w-full bg-transparent menu rounded-box">
<ul className="group py-1 px-2 w-full bg-transparent menu rounded-box">
<li tabIndex={0}>
<span
className={clsx(
@ -183,7 +183,7 @@ export const Sidebar = () => {
router.asPath.includes('/tokenfactory') ? 'text-white' : 'text-gray',
)}
>
<Link href="/badges/">Tokens</Link>
<Link href="/tokenfactory/">Tokens</Link>
</span>
<ul className="z-50 p-2 rounded-box bg-base-200">
<li
@ -208,7 +208,7 @@ export const Sidebar = () => {
</ul>
</li>
</ul>
<ul className="group p-2 w-full bg-transparent menu rounded-box">
<ul className="group py-1 px-2 w-full bg-transparent menu rounded-box">
<li tabIndex={0}>
<span
className={clsx(
@ -312,6 +312,19 @@ export const Sidebar = () => {
</ul>
</li>
</ul>
<ul className="group py-1 px-2 w-full bg-transparent menu rounded-box">
<li tabIndex={0}>
<span
className={clsx(
'z-40 text-xl font-bold group-hover:text-white bg-transparent rounded-lg small-caps',
'hover:bg-white/5 transition-colors',
router.asPath.includes('/authz/') ? 'text-white' : 'text-gray',
)}
>
<Link href="/authz/"> Authz </Link>
</span>
</li>
</ul>
</div>
<IncomeDashboardDisclaimer creatorAddress={wallet.address ? wallet.address : ''} />

324
config/authz.ts Normal file
View File

@ -0,0 +1,324 @@
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable no-nested-ternary */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable camelcase */
import { GenericAuthorization } from 'cosmjs-types/cosmos/authz/v1beta1/authz'
import { MsgGrant } from 'cosmjs-types/cosmos/authz/v1beta1/tx'
import { SendAuthorization } from 'cosmjs-types/cosmos/bank/v1beta1/authz'
import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin'
import type { AuthorizationType } from 'cosmjs-types/cosmos/staking/v1beta1/authz'
import { StakeAuthorization, StakeAuthorization_Validators } from 'cosmjs-types/cosmos/staking/v1beta1/authz'
import {
AcceptedMessageKeysFilter,
AllowAllMessagesFilter,
CombinedLimit,
ContractExecutionAuthorization,
ContractMigrationAuthorization,
MaxCallsLimit,
MaxFundsLimit,
} from 'cosmjs-types/cosmwasm/wasm/v1/authz'
import type { AuthorizationMode, GenericAuthorizationType, GrantAuthorizationType } from 'pages/authz/grant'
export interface Msg {
typeUrl: string
value: any
}
export interface AuthzMessage {
authzMode: AuthorizationMode
authzType: GrantAuthorizationType
displayName: string
typeUrl: string
genericAuthzType?: GenericAuthorizationType
}
export const grantGenericStakeAuthorization: AuthzMessage = {
authzMode: 'Grant',
authzType: 'Generic',
displayName: 'Stake',
typeUrl: '/cosmos.staking.v1beta1.MsgDelegate',
genericAuthzType: 'MsgDelegate',
}
export const grantGenericSendAuthorization: AuthzMessage = {
authzMode: 'Grant',
authzType: 'Generic',
displayName: 'Send',
typeUrl: '/cosmos.bank.v1beta1.MsgSend',
genericAuthzType: 'MsgSend',
}
export const authzMessages: AuthzMessage[] = [grantGenericStakeAuthorization, grantGenericSendAuthorization]
const msgAuthzGrantTypeUrl = '/cosmos.authz.v1beta1.MsgGrant'
export function AuthzSendGrantMsg(
granter: string,
grantee: string,
denom: string,
spendLimit: number,
expiration: number,
allowList?: string[],
): Msg {
const sendAuthValue = SendAuthorization.encode(
SendAuthorization.fromPartial({
spendLimit: [
Coin.fromPartial({
amount: String(spendLimit),
denom,
}),
],
// Needs cosmos-sdk >= 0.47
// allowList,
}),
).finish()
const grantValue = MsgGrant.fromPartial({
grant: {
authorization: {
typeUrl: '/cosmos.bank.v1beta1.SendAuthorization',
value: sendAuthValue,
},
expiration: expiration ? { seconds: BigInt(expiration) } : undefined,
},
grantee,
granter,
})
return {
typeUrl: msgAuthzGrantTypeUrl,
value: grantValue,
}
}
export function AuthzExecuteContractGrantMsg(
granter: string,
grantee: string,
contract: string,
expiration: number,
callsRemaining?: number,
amounts?: Coin[],
allowedMessages?: string[],
): Msg {
const sendAuthValue = ContractExecutionAuthorization.encode(
ContractExecutionAuthorization.fromPartial({
grants: [
{
contract,
filter: {
typeUrl: allowedMessages
? '/cosmwasm.wasm.v1.AcceptedMessageKeysFilter'
: '/cosmwasm.wasm.v1.AllowAllMessagesFilter',
value: allowedMessages
? AcceptedMessageKeysFilter.encode({ keys: allowedMessages }).finish()
: AllowAllMessagesFilter.encode({}).finish(),
},
limit:
callsRemaining || amounts
? {
typeUrl:
callsRemaining && amounts
? '/cosmwasm.wasm.v1.CombinedLimit'
: callsRemaining
? '/cosmwasm.wasm.v1.MaxCallsLimit'
: '/cosmwasm.wasm.v1.MaxFundsLimit',
value:
callsRemaining && amounts
? CombinedLimit.encode({
callsRemaining: BigInt(callsRemaining),
amounts,
}).finish()
: callsRemaining
? MaxCallsLimit.encode({
remaining: BigInt(callsRemaining),
}).finish()
: MaxFundsLimit.encode({
amounts: amounts || [],
}).finish(),
}
: {
// limit: undefined is not accepted
typeUrl: '/cosmwasm.wasm.v1.MaxCallsLimit',
value: MaxCallsLimit.encode({
remaining: BigInt(100000),
}).finish(),
},
},
],
}),
).finish()
const grantValue = MsgGrant.fromPartial({
grant: {
authorization: {
typeUrl: '/cosmwasm.wasm.v1.ContractExecutionAuthorization',
value: sendAuthValue,
},
expiration: expiration ? { seconds: BigInt(expiration), nanos: 0 } : undefined,
},
grantee,
granter,
})
return {
typeUrl: msgAuthzGrantTypeUrl,
value: grantValue,
}
}
export function AuthzMigrateContractGrantMsg(
granter: string,
grantee: string,
contract: string,
expiration: number,
callsRemaining?: number,
amounts?: Coin[],
allowedMessages?: string[],
): Msg {
const sendAuthValue = ContractMigrationAuthorization.encode(
ContractMigrationAuthorization.fromPartial({
grants: [
{
contract,
filter: {
typeUrl: allowedMessages
? '/cosmwasm.wasm.v1.AcceptedMessageKeysFilter'
: '/cosmwasm.wasm.v1.AllowAllMessagesFilter',
value: allowedMessages
? AcceptedMessageKeysFilter.encode({ keys: allowedMessages }).finish()
: AllowAllMessagesFilter.encode({}).finish(),
},
limit:
callsRemaining || amounts
? {
typeUrl:
callsRemaining && amounts
? '/cosmwasm.wasm.v1.CombinedLimit'
: callsRemaining
? '/cosmwasm.wasm.v1.MaxCallsLimit'
: '/cosmwasm.wasm.v1.MaxFundsLimit',
value:
callsRemaining && amounts
? CombinedLimit.encode({
callsRemaining: BigInt(callsRemaining),
amounts,
}).finish()
: callsRemaining
? MaxCallsLimit.encode({
remaining: BigInt(callsRemaining),
}).finish()
: MaxFundsLimit.encode({
amounts: amounts || [],
}).finish(),
}
: {
// limit: undefined is not accepted
typeUrl: '/cosmwasm.wasm.v1.MaxCallsLimit',
value: MaxCallsLimit.encode({
remaining: BigInt(100000),
}).finish(),
},
},
],
}),
).finish()
const grantValue = MsgGrant.fromPartial({
grant: {
authorization: {
typeUrl: '/cosmwasm.wasm.v1.ContractMigrationAuthorization',
value: sendAuthValue,
},
expiration: expiration ? { seconds: BigInt(expiration), nanos: 0 } : undefined,
},
grantee,
granter,
})
return {
typeUrl: msgAuthzGrantTypeUrl,
value: grantValue,
}
}
export function AuthzGenericGrantMsg(granter: string, grantee: string, typeURL: string, expiration: number): Msg {
return {
typeUrl: msgAuthzGrantTypeUrl,
value: {
grant: {
authorization: {
typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization',
value: GenericAuthorization.encode(
GenericAuthorization.fromPartial({
msg: typeURL,
}),
).finish(),
},
expiration: expiration ? { seconds: expiration } : undefined,
},
grantee,
granter,
},
}
}
export function AuthzStakeGrantMsg({
expiration,
grantee,
granter,
allowList,
denyList,
maxTokens,
denom,
stakeAuthzType,
}: {
granter: string
grantee: string
expiration: number
allowList?: string[]
denyList?: string[]
maxTokens?: string
denom?: string
stakeAuthzType: AuthorizationType
}): Msg {
const allow_list = StakeAuthorization_Validators.encode(
StakeAuthorization_Validators.fromPartial({
address: allowList,
}),
).finish()
const deny_list = StakeAuthorization_Validators.encode(
StakeAuthorization_Validators.fromPartial({
address: denyList,
}),
).finish()
const stakeAuthValue = StakeAuthorization.encode(
StakeAuthorization.fromPartial({
authorizationType: stakeAuthzType,
allowList: allowList?.length ? StakeAuthorization_Validators.decode(allow_list) : undefined,
denyList: denyList?.length ? StakeAuthorization_Validators.decode(deny_list) : undefined,
maxTokens: maxTokens
? Coin.fromPartial({
amount: maxTokens,
denom,
})
: undefined,
}),
).finish()
const grantValue = MsgGrant.fromPartial({
grant: {
authorization: {
typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization',
value: stakeAuthValue,
},
expiration: { seconds: BigInt(expiration) },
},
grantee,
granter,
})
return {
typeUrl: msgAuthzGrantTypeUrl,
value: grantValue,
}
}

View File

@ -1,6 +1,6 @@
{
"name": "stargaze-studio",
"version": "0.8.5",
"version": "0.8.7",
"workspaces": [
"packages/*"
],
@ -13,11 +13,12 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3",
"@cosmjs/cosmwasm-stargate": "^0",
"@cosmjs/encoding": "^0",
"@cosmjs/math": "^0",
"@cosmjs/proto-signing": "^0",
"@cosmjs/stargate": "^0",
"@cosmjs/cosmwasm-stargate": "0.32.2",
"@cosmjs/encoding": "0.32.2",
"@cosmjs/math": "0.32.2",
"@cosmjs/proto-signing": "0.32.2",
"@cosmjs/stargate": "0.32.2",
"cosmjs-types": "0.9.0",
"@cosmos-kit/keplr": "^2.4.4",
"@cosmos-kit/leap": "^2.4.3",
"@cosmos-kit/leap-metamask-cosmos-snap": "^0.3.3",
@ -61,7 +62,7 @@
"zustand": "^4"
},
"devDependencies": {
"@stargazezone/types": "^0.7.2",
"@stargazezone/types": "0.9.0",
"@types/node": "^14",
"@types/react": "^18",
"@types/react-datetime-picker": "^3",

366
pages/authz/grant.tsx Normal file
View File

@ -0,0 +1,366 @@
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
/* eslint-disable no-nested-ternary */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable tailwindcss/classnames-order */
import { coins, GasPrice, SigningStargateClient } from '@cosmjs/stargate'
import { Alert } from 'components/Alert'
import { Button } from 'components/Button'
import { Conditional } from 'components/Conditional'
import { ContractPageHeader } from 'components/ContractPageHeader'
import { FormControl } from 'components/FormControl'
import { AddressInput, NumberInput, TextInput } from 'components/forms/FormInput'
import { useInputState, useNumberInputState } from 'components/forms/FormInput.hooks'
import { InputDateTime } from 'components/InputDateTime'
import { LinkTabs } from 'components/LinkTabs'
import { authzLinkTabs } from 'components/LinkTabs.data'
import { getConfig } from 'config'
import type { Msg } from 'config/authz'
import {
AuthzExecuteContractGrantMsg,
AuthzGenericGrantMsg,
AuthzMigrateContractGrantMsg,
AuthzSendGrantMsg,
} from 'config/authz'
import { useGlobalSettings } from 'contexts/globalSettings'
import type { NextPage } from 'next'
import { NextSeo } from 'next-seo'
import { useState } from 'react'
import toast from 'react-hot-toast'
import { NETWORK } from 'utils/constants'
import { withMetadata } from 'utils/layout'
import { useWallet } from 'utils/wallet'
export type AuthorizationMode = 'Grant' | 'Revoke'
export type GrantAuthorizationType = 'Generic' | 'Send' | 'Execute Smart Contract' | 'Migrate Smart Contract'
export type GenericAuthorizationType =
| 'MsgDelegate'
| 'MsgUndelegate'
| 'MsgBeginRedelegate'
| 'MsgWithdrawDelegatorReward'
| 'MsgVote'
| 'MsgSend'
| 'MsgExecuteContract'
| 'MsgMigrateContract'
| 'MsgStoreCode'
const Grant: NextPage = () => {
const wallet = useWallet()
const { timezone } = useGlobalSettings()
const [authMode, setAuthMode] = useState<AuthorizationMode>('Grant')
const [authType, setAuthType] = useState<GrantAuthorizationType>('Generic')
const [genericAuthType, setGenericAuthType] = useState<GenericAuthorizationType>('MsgSend')
const [expiration, setExpiration] = useState<Date | undefined>()
const [transactionHash, setTransactionHash] = useState<string | undefined>(undefined)
const [isLoading, setIsLoading] = useState(false)
const granteeAddressState = useInputState({
id: 'grantee-address',
name: 'granteeAddress',
title: 'Grantee Address',
placeholder: 'stars1...',
subtitle: 'The address to grant authorization to',
})
const spendLimitDenomState = useInputState({
id: 'spend-limit-denom',
name: 'spendLimitDenom',
title: 'Spend Limit Denom',
placeholder: `ustars`,
subtitle: 'The spend limit denom',
})
const spendLimitState = useNumberInputState({
id: 'spend-limit',
name: 'spendLimit',
title: 'Spend Limit',
placeholder: `1000000`,
subtitle: 'The spend limit',
})
const maxFundsLimitDenomState = useInputState({
id: 'max-funds-limit-denom',
name: 'maxFundsLimitDenom',
title: 'Max Funds Limit Denom',
placeholder: `ustars`,
subtitle: 'The denom for max funds limit',
})
const maxFundsLimitState = useNumberInputState({
id: 'max-funds-limit',
name: 'maxFundsLimit',
title: 'Max Funds Limit',
placeholder: `1000000`,
subtitle: 'The max funds limit for contract execution (leave blank for no limit)',
})
const allowListState = useInputState({
id: 'allow-list',
name: 'allowList',
title: 'Allow List',
placeholder: `stars1..., stars1...`,
subtitle: 'Comma separated list of addresses to allow transactions to',
})
const contractAddressState = useInputState({
id: 'contract-address',
name: 'contractAddress',
title: 'Contract Address',
placeholder: `stars1...`,
subtitle: 'The contract address to authorize execution on',
})
const allowedMessageKeysState = useInputState({
id: 'allowed-message-keys',
name: 'allowedMessageKeys',
title: 'Allowed Message Keys',
placeholder: `mint_to, burn, transfer`,
subtitle: 'Comma separated list of allowed message keys (leave blank to allow all)',
})
const callsRemainingState = useNumberInputState({
id: 'calls-remaining',
name: 'callsRemaining',
title: 'Calls Remaining',
placeholder: `10`,
subtitle: 'The allowed number of contract execution calls (leave blank for no limit)',
})
const messageToSign = () => {
if (authType === 'Generic') {
if (genericAuthType === 'MsgSend') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmos.bank.v1beta1.MsgSend',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgDelegate') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmos.staking.v1beta1.MsgDelegate',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgUndelegate') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmos.staking.v1beta1.MsgUndelegate',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgBeginRedelegate') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmos.staking.v1beta1.MsgBeginRedelegate',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgWithdrawDelegatorReward') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgVote') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmos.gov.v1beta1.MsgVote',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgExecuteContract') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmwasm.wasm.v1.MsgExecuteContract',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgMigrateContract') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmwasm.wasm.v1.MsgMigrateContract',
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgStoreCode') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmwasm.wasm.v1.MsgStoreCode',
(expiration?.getTime() as number) / 1000 || 0,
)
}
} else if (authType === 'Send') {
return AuthzSendGrantMsg(
wallet.address || '',
granteeAddressState.value,
spendLimitDenomState.value,
spendLimitState.value,
(expiration?.getTime() as number) / 1000 || 0,
allowListState.value ? allowListState.value.split(',').map((address) => address.trim()) : [],
)
} else if (authType === 'Execute Smart Contract') {
return AuthzExecuteContractGrantMsg(
wallet.address || '',
granteeAddressState.value,
contractAddressState.value,
(expiration?.getTime() as number) / 1000 || 0,
callsRemainingState.value ? callsRemainingState.value : undefined,
maxFundsLimitState.value > 0 ? coins(maxFundsLimitState.value, maxFundsLimitDenomState.value) : undefined,
allowedMessageKeysState.value ? allowedMessageKeysState.value.split(',').map((key) => key.trim()) : undefined,
)
} else if (authType === 'Migrate Smart Contract') {
return AuthzMigrateContractGrantMsg(
wallet.address || '',
granteeAddressState.value,
contractAddressState.value,
(expiration?.getTime() as number) / 1000 || 0,
callsRemainingState.value ? callsRemainingState.value : undefined,
maxFundsLimitState.value > 0 ? coins(maxFundsLimitState.value, maxFundsLimitDenomState.value) : undefined,
allowedMessageKeysState.value ? allowedMessageKeysState.value.split(',').map((key) => key.trim()) : undefined,
)
}
}
const handleSendMessage = async () => {
try {
if (!wallet.isWalletConnected) return toast.error('Please connect your wallet.')
setTransactionHash(undefined)
setIsLoading(true)
const offlineSigner = wallet.getOfflineSignerDirect()
const stargateClient = await SigningStargateClient.connectWithSigner(getConfig(NETWORK).rpcUrl, offlineSigner, {
gasPrice: GasPrice.fromString('0.025ustars'),
})
const response = await stargateClient.signAndBroadcast(wallet.address || '', [messageToSign() as Msg], 'auto')
setTransactionHash(response.transactionHash)
toast.success(`${authType} authorization success.`, { style: { maxWidth: 'none' } })
setIsLoading(false)
} catch (error: any) {
toast.error(error.message, { style: { maxWidth: 'none' } })
setIsLoading(false)
setTransactionHash(undefined)
console.error('Error: ', error)
}
}
return (
<section className="px-4 pt-4 pb-16 mx-auto space-y-8 ml-8 w-full">
<NextSeo title="Authorization" />
<ContractPageHeader
description="Here you can grant and revoke authorizations."
link="https://docs.stargaze.zone/developers/authz"
title="Authorization"
/>
<LinkTabs activeIndex={0} data={authzLinkTabs} />
<div className="flex flex-col w-1/4">
<span className="text-xl font-bold text-white">Authorization Type</span>
<select
className="mt-2 pt-2 pb-2 px-4 placeholder:text-white/50 bg-white/10 rounded border-2 border-white/20 focus:ring focus:ring-plumbus-20"
onChange={(e) => setAuthType(e.target.value as GrantAuthorizationType)}
value={authType}
>
<option value="Generic">Generic</option>
<option value="Send">Send</option>
<option value="Execute Smart Contract">Execute Smart Contract</option>
<option value="Migrate Smart Contract">Migrate Smart Contract</option>
</select>
</div>
<Conditional test={authType === 'Generic'}>
<div className="flex flex-col w-1/4">
<span className="text-lg font-bold text-white">Generic Authorization Type</span>
<select
className="mt-2 pt-2 pb-2 px-4 placeholder:text-white/50 bg-white/10 rounded border-2 border-white/20 focus:ring focus:ring-plumbus-20"
onChange={(e) => setGenericAuthType(e.target.value as GenericAuthorizationType)}
value={genericAuthType}
>
<option value="MsgSend">Send</option>
<option value="MsgDelegate">Delegate</option>
<option value="MsgUndelegate">Undelegate</option>
<option value="MsgBeginRedelegate">Redelegate</option>
<option value="MsgWithdrawDelegatorReward">Withdraw Delegator Reward</option>
<option value="MsgVote">Vote</option>
<option value="MsgExecuteContract">Execute Contract</option>
<option value="MsgMigrateContract">Migrate Contract</option>
<option value="MsgStoreCode">Store Code</option>
</select>
</div>
</Conditional>
<TextInput className="w-2/5" {...granteeAddressState} />
<Conditional test={authType === 'Send'}>
<div className="flex flex-row">
<NumberInput className="w-1/4" {...spendLimitState} />
<TextInput className="w-1/4 ml-2" {...spendLimitDenomState} />
</div>
{/* Needs cosmos-sdk v0.47 */}
{/* <TextInput className="w-2/5" {...allowListState} /> */}
</Conditional>
<Conditional test={authType === 'Execute Smart Contract' || authType === 'Migrate Smart Contract'}>
<AddressInput className="w-2/5" {...contractAddressState} />
<TextInput className="w-2/5" {...allowedMessageKeysState} />
<NumberInput className="w-2/5" {...callsRemainingState} />
<div className="flex flex-row">
<NumberInput className="w-2/5" {...maxFundsLimitState} />
<TextInput className="w-1/4 ml-2" {...maxFundsLimitDenomState} />
</div>
</Conditional>
<FormControl
className="w-1/4"
htmlId="expiration"
subtitle={`Expiration time for the authorization ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
title="Expiration Time (Optional)"
>
<InputDateTime
minDate={
timezone === 'Local' ? new Date() : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
}
onChange={(date) =>
date
? setExpiration(
timezone === 'Local' ? date : new Date(date?.getTime() - new Date().getTimezoneOffset() * 60 * 1000),
)
: setExpiration(undefined)
}
value={
timezone === 'Local'
? expiration
: expiration
? new Date(expiration.getTime() + new Date().getTimezoneOffset() * 60 * 1000)
: undefined
}
/>
</FormControl>
<Button
className="px-4 py-2 font-bold text-white bg-stargaze rounded-md"
isLoading={isLoading}
onClick={() => {
void handleSendMessage()
}}
>
{' '}
{authMode === 'Grant' ? 'Grant Authorization' : 'Revoke Authorization'}
</Button>
{transactionHash && (
<Alert className="justify-center items-center space-y-2 w-3/4" type="info">
{`Transaction Hash: ${transactionHash}`}
</Alert>
)}
</section>
)
}
export default withMetadata(Grant, { center: false })

1
pages/authz/index.tsx Normal file
View File

@ -0,0 +1 @@
export { default } from './grant'

144
pages/authz/revoke.tsx Normal file
View File

@ -0,0 +1,144 @@
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { GasPrice, SigningStargateClient } from '@cosmjs/stargate'
import { Alert } from 'components/Alert'
import { Button } from 'components/Button'
import { ContractPageHeader } from 'components/ContractPageHeader'
import { TextInput } from 'components/forms/FormInput'
import { useInputState } from 'components/forms/FormInput.hooks'
import { LinkTabs } from 'components/LinkTabs'
import { authzLinkTabs } from 'components/LinkTabs.data'
import { getConfig } from 'config'
import type { NextPage } from 'next'
import { NextSeo } from 'next-seo'
import { useState } from 'react'
import toast from 'react-hot-toast'
import { NETWORK } from 'utils/constants'
import { withMetadata } from 'utils/layout'
import { useWallet } from 'utils/wallet'
const RevokeAuthorization: NextPage = () => {
const wallet = useWallet()
const [transactionHash, setTransactionHash] = useState<string | undefined>(undefined)
const [isLoading, setIsLoading] = useState(false)
const granteeAddressState = useInputState({
id: 'grantee-address',
name: 'granteeAddress',
title: 'Grantee Address',
subtitle: 'Address to revoke message authorization',
placeholder: 'stars1...',
})
const messageState = useInputState({
id: 'message',
name: 'message',
title: 'Message',
subtitle: 'Message to revoke authorization for',
placeholder: '/cosmos.bank.v1beta1.MsgSend',
defaultValue: '/cosmos.bank.v1beta1.MsgSend',
})
const revokeAuthorization = async (granteeAddress: string, msg: string) => {
try {
if (!wallet.isWalletConnected) throw new Error('Wallet not connected.')
setTransactionHash(undefined)
setIsLoading(true)
const offlineSigner = wallet.getOfflineSignerDirect()
const stargateClient = await SigningStargateClient.connectWithSigner(getConfig(NETWORK).rpcUrl, offlineSigner, {
gasPrice: GasPrice.fromString('0.25ustars'),
})
const response = await stargateClient.signAndBroadcast(
wallet.address || '',
[
{
typeUrl: '/cosmos.authz.v1beta1.MsgRevoke',
value: {
granter: wallet.address,
grantee: granteeAddress,
msgTypeUrl: msg,
},
},
],
{
amount: [{ amount: '500000', denom: 'ustars' }],
gas: '200000',
},
)
setTransactionHash(response.transactionHash)
if (response.rawLog?.includes('failed')) toast.error(response.rawLog, { style: { maxWidth: 'none' } })
else toast.success(`Revoke authorization success.`, { style: { maxWidth: 'none' } })
setIsLoading(false)
} catch (e: any) {
console.log(e)
setIsLoading(false)
setTransactionHash(undefined)
toast.error(e.message, { style: { maxWidth: 'none' } })
}
}
return (
<section className="px-4 pt-4 pb-16 mx-auto ml-8 space-y-8 w-full">
<NextSeo title="Authorization" />
<ContractPageHeader
description="Here you can grant and revoke authorizations."
link="https://docs.stargaze.zone/developers/authz"
title="Authorization"
/>
<LinkTabs activeIndex={1} data={authzLinkTabs} />
<div className="flex flex-col w-2/5">
<span className="font-bold text-white">Authorization Type</span>
<select
className="py-2 px-4 mt-2 bg-black rounded-md border-2 border-white"
onChange={(e) => messageState.onChange(e.target.value)}
>
<option className="bg-black" value="/cosmos.bank.v1beta1.MsgSend">
/cosmos.bank.v1beta1.MsgSend
</option>
<option className="bg-black" value="/cosmos.staking.v1beta1.MsgDelegate">
/cosmos.staking.v1beta1.MsgDelegate
</option>
<option className="bg-black" value="/cosmos.staking.v1beta1.MsgUndelegate">
/cosmos.staking.v1beta1.MsgUndelegate
</option>
<option className="bg-black" value="/cosmos.staking.v1beta1.MsgBeginRedelegate">
/cosmos.staking.v1beta1.MsgBeginRedelegate
</option>
<option className="bg-black" value="/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward">
/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
</option>
<option className="bg-black" value="/cosmos.gov.v1beta1.MsgVote">
/cosmos.gov.v1beta1.MsgVote
</option>
<option className="bg-black" value="/cosmwasm.wasm.v1.MsgExecuteContract">
/cosmwasm.wasm.v1.MsgExecuteContract
</option>
<option className="bg-black" value="/cosmwasm.wasm.v1.MsgMigrateContract">
/cosmwasm.wasm.v1.MsgMigrateContract
</option>
<option className="bg-black" value="/cosmwasm.wasm.v1.MsgStoreCode">
/cosmwasm.wasm.v1.MsgStoreCode
</option>
</select>
</div>
<TextInput className="w-2/5" {...granteeAddressState} />
{/* <TextInput className="w-1/3" {...messageState} /> */}
<Button
className="text-white bg-stargaze btn"
isLoading={isLoading}
onClick={() => void revokeAuthorization(granteeAddressState.value, messageState.value)}
type="button"
>
Revoke Authorization
</Button>
{transactionHash && (
<Alert className="justify-center items-center space-y-2 w-3/4" type="info">
{`Transaction Hash: ${transactionHash}`}
</Alert>
)}
</section>
)
}
export default withMetadata(RevokeAuthorization, { center: false })

View File

@ -1,4 +1,5 @@
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import clsx from 'clsx'
import { Alert } from 'components/Alert'
@ -62,8 +63,7 @@ const UploadContract: NextPage = () => {
codeId: result.codeId,
originalSize: result.originalSize,
compressedSize: result.compressedSize,
originalChecksum: result.originalChecksum,
compressedChecksum: result.compressedChecksum,
originalChecksum: result.checksum,
})
setLoading(false)

View File

@ -1,97 +0,0 @@
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { coins } from '@cosmjs/proto-signing'
import { ContractPageHeader } from 'components/ContractPageHeader'
import { TextInput } from 'components/forms/FormInput'
import { useInputState } from 'components/forms/FormInput.hooks'
import type { NextPage } from 'next'
import { NextSeo } from 'next-seo'
import { useState } from 'react'
import toast from 'react-hot-toast'
import { withMetadata } from 'utils/layout'
import { links } from 'utils/links'
import { useWallet } from 'utils/wallet'
const RevokeAuthorization: NextPage = () => {
const wallet = useWallet()
const [transactionHash, setTransactionHash] = useState<string | undefined>(undefined)
const granteeAddressState = useInputState({
id: 'grantee-address',
name: 'granteeAddress',
title: 'Grantee Address',
subtitle: 'Address to revoke message authorization',
placeholder: 'stars1234567890abcdefghijklmnopqrstuvwxyz...',
defaultValue: 'stars12vfpmlvmqrh9p0kcrtv6lw9ylkh7reuczdmmz5',
})
const messageState = useInputState({
id: 'message',
name: 'message',
title: 'Message',
subtitle: 'Message to revoke authorization for',
placeholder: '/cosmos.bank.v1beta1.MsgSend',
defaultValue: '/cosmos.bank.v1beta1.MsgSend',
})
const revokeAuthorization = async (granteeAddress: string, msg: string) => {
console.log('Wallet Address: ', wallet.address)
try {
if (!wallet.isWalletConnected) throw new Error('Wallet not connected.')
const result = await (
await wallet.getSigningCosmWasmClient()
).signAndBroadcast(
wallet.address || '',
[
{
typeUrl: '/cosmos.authz.v1beta1.MsgRevoke',
value: {
granter: wallet.address,
grantee: granteeAddress,
msgTypeUrl: msg,
funds: coins('100000', 'ustars'),
},
},
],
'auto',
)
setTransactionHash(result.transactionHash)
} catch (e: any) {
console.log(e)
toast.error(e.message, { style: { maxWidth: 'none' } })
}
}
return (
<section className="py-6 px-12 space-y-4">
<NextSeo title="Revoke Authorization" />
<ContractPageHeader description="Revoke Authorization." link={links.Documentation} title="Revoke Authorization" />
<TextInput {...granteeAddressState} />
<div className="font-bold">Message Types</div>
<select
className="py-2 px-4 bg-black border-2 border-white"
onChange={(e) => messageState.onChange(e.target.value)}
>
<option className="bg-black" value="/cosmos.bank.v1beta1.MsgSend">
/cosmos.bank.v1beta1.MsgSend
</option>
<option className="bg-black" value="/cosmos.staking.v1beta1.MsgUndelegate">
/cosmos.staking.v1beta1.MsgUndelegate
</option>
</select>
<TextInput {...messageState} />
<button
className="text-white bg-stargaze btn"
onClick={() => void revokeAuthorization(granteeAddressState.value, messageState.value)}
type="button"
>
Revoke Authorization
</button>
{transactionHash && (
<div className="justify-center items-center space-y-2">{`Transaction Hash: ${transactionHash}`}</div>
)}
</section>
)
}
export default withMetadata(RevokeAuthorization, { center: false })

274
yarn.lock
View File

@ -1987,16 +1987,6 @@
"@noble/hashes" "^1.0.0"
protobufjs "^6.8.8"
"@cosmjs/amino@0.28.4":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.4.tgz"
integrity sha512-b8y5gFC0eGrH0IoYSNtDmTdsTgeQ1KFZ5YVOeIiKmzF91MeiciYO/MNqc027kctacZ+UbnVWGEUGyRBPi9ta/g==
dependencies:
"@cosmjs/crypto" "0.28.4"
"@cosmjs/encoding" "0.28.4"
"@cosmjs/math" "0.28.4"
"@cosmjs/utils" "0.28.4"
"@cosmjs/amino@^0.31.0", "@cosmjs/amino@^0.31.1":
version "0.31.1"
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.31.1.tgz#e6b4adc3ebe19ddfd953c67ee04b1eae488238af"
@ -2007,36 +1997,31 @@
"@cosmjs/math" "^0.31.1"
"@cosmjs/utils" "^0.31.1"
"@cosmjs/cosmwasm-stargate@^0":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.28.4.tgz"
integrity sha512-dkTwTD+j2mjk7+l3pQQ3io2D0U7NIA4LXzkKtfBN87PGlj2G+VJFzcXk1T4DYmvrXjsQOi1kYeQRGWFA0XdvnQ==
"@cosmjs/amino@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.2.tgz#ba3cf255e4e6b1ba67461f1ef7b0b8ad3f895da7"
integrity sha512-lcK5RCVm4OfdAooxKcF2+NwaDVVpghOq6o/A40c2mHXDUzUoRZ33VAHjVJ9Me6vOFxshrw/XEFn1f4KObntjYA==
dependencies:
"@cosmjs/amino" "0.28.4"
"@cosmjs/crypto" "0.28.4"
"@cosmjs/encoding" "0.28.4"
"@cosmjs/math" "0.28.4"
"@cosmjs/proto-signing" "0.28.4"
"@cosmjs/stargate" "0.28.4"
"@cosmjs/tendermint-rpc" "0.28.4"
"@cosmjs/utils" "0.28.4"
cosmjs-types "^0.4.0"
long "^4.0.0"
pako "^2.0.2"
protobufjs "~6.10.2"
"@cosmjs/crypto" "^0.32.2"
"@cosmjs/encoding" "^0.32.2"
"@cosmjs/math" "^0.32.2"
"@cosmjs/utils" "^0.32.2"
"@cosmjs/crypto@0.28.4":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.28.4.tgz"
integrity sha512-JRxNLlED3DDh9d04A0RcRw3mYkoobN7q7wafUFy3vI1TjoyWx33v0gqqaYE6/hoo9ghUrJSVOfzVihl8fZajJA==
"@cosmjs/cosmwasm-stargate@0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.2.tgz#32aca8b4c2043cd1bc91cf4d0225b268c166e421"
integrity sha512-OwJHzIx2CoJS6AULxOpNR6m+CI0GXxy8z9svHA1ZawzNM3ZGlL0GvHdhmF0WkpX4E7UdrYlJSLpKcgg5Fo6i7Q==
dependencies:
"@cosmjs/encoding" "0.28.4"
"@cosmjs/math" "0.28.4"
"@cosmjs/utils" "0.28.4"
"@noble/hashes" "^1"
bn.js "^5.2.0"
elliptic "^6.5.3"
libsodium-wrappers "^0.7.6"
"@cosmjs/amino" "^0.32.2"
"@cosmjs/crypto" "^0.32.2"
"@cosmjs/encoding" "^0.32.2"
"@cosmjs/math" "^0.32.2"
"@cosmjs/proto-signing" "^0.32.2"
"@cosmjs/stargate" "^0.32.2"
"@cosmjs/tendermint-rpc" "^0.32.2"
"@cosmjs/utils" "^0.32.2"
cosmjs-types "^0.9.0"
pako "^2.0.2"
"@cosmjs/crypto@^0.31.1":
version "0.31.1"
@ -2051,10 +2036,23 @@
elliptic "^6.5.4"
libsodium-wrappers-sumo "^0.7.11"
"@cosmjs/encoding@0.28.4", "@cosmjs/encoding@^0":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.4.tgz"
integrity sha512-N6Qnjs4dd8KwjW5m9t3L+rWYYGW2wyS+iLtJJ9DD8DiTTxpW9h7/AmUVO/dsRe5H2tV8/DzH/B9pFfpsgro22A==
"@cosmjs/crypto@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.2.tgz#8ed255d3d1c1c4d916a1586f8cbc33eaab82f511"
integrity sha512-RuxrYKzhrPF9g6NmU7VEq++Hn1vZJjqqJpZ9Tmw9lOYOV8BUsv+j/0BE86kmWi7xVJ7EwxiuxYsKuM8IR18CIA==
dependencies:
"@cosmjs/encoding" "^0.32.2"
"@cosmjs/math" "^0.32.2"
"@cosmjs/utils" "^0.32.2"
"@noble/hashes" "^1"
bn.js "^5.2.0"
elliptic "^6.5.4"
libsodium-wrappers-sumo "^0.7.11"
"@cosmjs/encoding@0.32.2", "@cosmjs/encoding@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.2.tgz#8c5c64481a85cd570740c34dccce69d024a29805"
integrity sha512-WX7m1wLpA9V/zH0zRcz4EmgZdAv1F44g4dbXOgNj1eXZw1PIGR12p58OEkLN51Ha3S4DKRtCv5CkhK1KHEvQtg==
dependencies:
base64-js "^1.3.0"
bech32 "^1.1.4"
@ -2069,18 +2067,18 @@
bech32 "^1.1.4"
readonly-date "^1.0.0"
"@cosmjs/json-rpc@0.28.4":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.28.4.tgz"
integrity sha512-An8ZQi9OKbnS8ew/MyHhF90zQpXBF8RTj2wdvIH+Hr8yA6QjynY8hxRpUwYUt3Skc5NeUnTZNuWCzlluHnoxVg==
"@cosmjs/json-rpc@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.2.tgz#f87fab0d6975ed1d1c7daafcf6f1f81e5e296912"
integrity sha512-lan2lOgmz4yVE/HR8eCOSiII/1OudIulk8836koyIDCsPEpt6eKBuctnAD168vABGArKccLAo7Mr2gy9nrKrOQ==
dependencies:
"@cosmjs/stream" "0.28.4"
"@cosmjs/stream" "^0.32.2"
xstream "^11.14.0"
"@cosmjs/math@0.28.4", "@cosmjs/math@^0":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.4.tgz"
integrity sha512-wsWjbxFXvk46Dsx8jQ5vsBZOIQuiUIyaaZbUvxsgIhAMpuuBnV5O/drK87+B+4cL+umTelFqTbWnkqueVCIFxQ==
"@cosmjs/math@0.32.2", "@cosmjs/math@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.2.tgz#4522312769197e132679e4960862bcec0eed4cb8"
integrity sha512-b8+ruAAY8aKtVKWSft2IvtCVCUH1LigIlf9ALIiY8n9jtM4kMASiaRbQ/27etnSAInV88IaezKK9rQZrtxTjcw==
dependencies:
bn.js "^5.2.0"
@ -2091,19 +2089,17 @@
dependencies:
bn.js "^5.2.0"
"@cosmjs/proto-signing@0.28.4", "@cosmjs/proto-signing@^0":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.28.4.tgz"
integrity sha512-4vgCLK9gOsdWzD78V5XbAsupSSyntPEzokWYhgRQNwgVTcKX1kg0eKZqUvF5ua5iL9x6MevfH/sgwPyiYleMBw==
"@cosmjs/proto-signing@0.32.2", "@cosmjs/proto-signing@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.2.tgz#26ed2675978ce24078981f4c15a06c5d6b808f44"
integrity sha512-UV4WwkE3W3G3s7wwU9rizNcUEz2g0W8jQZS5J6/3fiN0mRPwtPKQ6EinPN9ASqcAJ7/VQH4/9EPOw7d6XQGnqw==
dependencies:
"@cosmjs/amino" "0.28.4"
"@cosmjs/crypto" "0.28.4"
"@cosmjs/encoding" "0.28.4"
"@cosmjs/math" "0.28.4"
"@cosmjs/utils" "0.28.4"
cosmjs-types "^0.4.0"
long "^4.0.0"
protobufjs "~6.10.2"
"@cosmjs/amino" "^0.32.2"
"@cosmjs/crypto" "^0.32.2"
"@cosmjs/encoding" "^0.32.2"
"@cosmjs/math" "^0.32.2"
"@cosmjs/utils" "^0.32.2"
cosmjs-types "^0.9.0"
"@cosmjs/proto-signing@^0.31.0":
version "0.31.1"
@ -2118,67 +2114,65 @@
cosmjs-types "^0.8.0"
long "^4.0.0"
"@cosmjs/socket@0.28.4":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.28.4.tgz"
integrity sha512-jAEL3Ri+s8XuBM3mqgO4yvmeQu+R+704V37lGROC1B6kAbGxWRyOWrMdOOiFJzCZ35sSMB7L+xKjpE8ug0vJjg==
"@cosmjs/socket@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.2.tgz#a66be3863d03bf2d8df0433af476df010ff10e8c"
integrity sha512-Qc8jaw4uSBJm09UwPgkqe3g9TBFx4ZR9HkXpwT6Z9I+6kbLerXPR0Gy3NSJFSUgxIfTpO8O1yqoWAyf0Ay17Mw==
dependencies:
"@cosmjs/stream" "0.28.4"
"@cosmjs/stream" "^0.32.2"
isomorphic-ws "^4.0.1"
ws "^7"
xstream "^11.14.0"
"@cosmjs/stargate@0.28.4", "@cosmjs/stargate@^0":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.28.4.tgz"
integrity sha512-tdwudilP5iLNwDm4TOMBjWuL5YehLPqGlC5/7hjJM/kVHyzLFo4Lzt0dVEwr5YegH+RsRXH/VtFLQz+NYlCobw==
"@cosmjs/stargate@0.32.2", "@cosmjs/stargate@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.2.tgz#73718c5c6a3ae138682ee9987333d911eca22a13"
integrity sha512-AsJa29fT7Jd4xt9Ai+HMqhyj7UQu7fyYKdXj/8+/9PD74xe6lZSYhQPcitUmMLJ1ckKPgXSk5Dd2LbsQT0IhZg==
dependencies:
"@confio/ics23" "^0.6.8"
"@cosmjs/amino" "0.28.4"
"@cosmjs/encoding" "0.28.4"
"@cosmjs/math" "0.28.4"
"@cosmjs/proto-signing" "0.28.4"
"@cosmjs/stream" "0.28.4"
"@cosmjs/tendermint-rpc" "0.28.4"
"@cosmjs/utils" "0.28.4"
cosmjs-types "^0.4.0"
long "^4.0.0"
protobufjs "~6.10.2"
"@cosmjs/amino" "^0.32.2"
"@cosmjs/encoding" "^0.32.2"
"@cosmjs/math" "^0.32.2"
"@cosmjs/proto-signing" "^0.32.2"
"@cosmjs/stream" "^0.32.2"
"@cosmjs/tendermint-rpc" "^0.32.2"
"@cosmjs/utils" "^0.32.2"
cosmjs-types "^0.9.0"
xstream "^11.14.0"
"@cosmjs/stream@0.28.4":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.28.4.tgz"
integrity sha512-BDwDdFOrOgRx/Wm5nknb9YCV9HHIUcsOxykTDZqdArCUsn4QJBq79QIjp919G05Z8UemkoHwiUCUNB2BfoKmFw==
"@cosmjs/stream@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.2.tgz#b1e8f977d25313d659f1aa89ad21614b5391cd93"
integrity sha512-gpCufLfHAD8Zp1ZKge7AHbDf4RA0TZp66wZY6JaQR5bSiEF2Drjtp4mwXZPGejtaUMnaAgff3LrUzPJfKYdQwg==
dependencies:
xstream "^11.14.0"
"@cosmjs/tendermint-rpc@0.28.4":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.28.4.tgz"
integrity sha512-iz6p4UW2QUZNh55WeJy9wHbMdqM8COo0AJdrGU4Ikb/xU0/H6b0dFPoEK+i6ngR0cSizh+hpTMzh3AA7ySUKlA==
"@cosmjs/tendermint-rpc@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.2.tgz#c5607b8d472e5bf9fd58d5453db7194f500ccc62"
integrity sha512-DXyJHDmcAfCix4H/7/dKR0UMdshP01KxJOXHdHxBCbLIpck94BsWD3B2ZTXwfA6sv98so9wOzhp7qGQa5malxg==
dependencies:
"@cosmjs/crypto" "0.28.4"
"@cosmjs/encoding" "0.28.4"
"@cosmjs/json-rpc" "0.28.4"
"@cosmjs/math" "0.28.4"
"@cosmjs/socket" "0.28.4"
"@cosmjs/stream" "0.28.4"
"@cosmjs/utils" "0.28.4"
axios "^0.21.2"
"@cosmjs/crypto" "^0.32.2"
"@cosmjs/encoding" "^0.32.2"
"@cosmjs/json-rpc" "^0.32.2"
"@cosmjs/math" "^0.32.2"
"@cosmjs/socket" "^0.32.2"
"@cosmjs/stream" "^0.32.2"
"@cosmjs/utils" "^0.32.2"
axios "^1.6.0"
readonly-date "^1.0.0"
xstream "^11.14.0"
"@cosmjs/utils@0.28.4":
version "0.28.4"
resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.4.tgz"
integrity sha512-lb3TU6833arPoPZF8HTeG9V418CpurvqH5Aa/ls0I0wYdPDEMO6622+PQNQhQ8Vw8Az2MXoSyc8jsqrgawT84Q==
"@cosmjs/utils@^0.31.1":
version "0.31.1"
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.1.tgz#e6055cd7d722fa72df9cbd0d39cd1f7a9ac80483"
integrity sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==
"@cosmjs/utils@^0.32.2":
version "0.32.2"
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.2.tgz#324304aa85bfa6f10561cc17781d824d02130897"
integrity sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q==
"@cosmos-kit/core@^2.7.2":
version "2.7.2"
resolved "https://registry.yarnpkg.com/@cosmos-kit/core/-/core-2.7.2.tgz#de279f20fdd63cc088e18e6bd769120ef7ad8b49"
@ -3048,10 +3042,10 @@
"@stablelib/random" "^1.0.2"
"@stablelib/wipe" "^1.0.1"
"@stargazezone/types@^0.7.2":
version "0.7.2"
resolved "https://registry.npmjs.org/@stargazezone/types/-/types-0.7.2.tgz"
integrity sha512-hnSOLvBbZ8/PZs+WHKBbKpZF/JiwNdfNeP4yiNBZGm6gpTLuQ1enaPC/roRoqIFHp8JaGL5HTa/E3GoeUnzRbQ==
"@stargazezone/types@0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@stargazezone/types/-/types-0.9.0.tgz#77ef70b9079d0be585b46583161bd62c2870c7fa"
integrity sha512-Za+Fv9aFY34vSx0q2AbcB+9f+T26PgK1iJxMj3yv6NpyVwBhJoHp/ampxheGhU00TSlofhNGgAK3+eYKLy1D3w==
dependencies:
dotenv "^10.0.0"
json-schema-to-typescript "^10.1.5"
@ -3248,11 +3242,6 @@
resolved "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz"
integrity sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==
"@types/node@^13.7.0":
version "13.13.52"
resolved "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz"
integrity sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==
"@types/node@^14":
version "14.18.16"
resolved "https://registry.npmjs.org/@types/node/-/node-14.18.16.tgz"
@ -4157,13 +4146,22 @@ axios@^0:
follow-redirects "^1.14.9"
form-data "^4.0.0"
axios@^0.21.1, axios@^0.21.2:
axios@^0.21.1:
version "0.21.4"
resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
dependencies:
follow-redirects "^1.14.0"
axios@^1.6.0:
version "1.6.5"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.5.tgz#2c090da14aeeab3770ad30c3a1461bc970fb0cd8"
integrity sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==
dependencies:
follow-redirects "^1.15.4"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
axobject-query@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz"
@ -4727,13 +4725,10 @@ cosmiconfig@^7.0.1:
path-type "^4.0.0"
yaml "^1.10.0"
cosmjs-types@^0.4.0:
version "0.4.1"
resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz"
integrity sha512-I7E/cHkIgoJzMNQdFF0YVqPlaTqrqKHrskuSTIqlEyxfB5Lf3WKCajSXVK2yHOfOFfSux/RxEdpMzw/eO4DIog==
dependencies:
long "^4.0.0"
protobufjs "~6.11.2"
cosmjs-types@0.9.0, cosmjs-types@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.9.0.tgz#c3bc482d28c7dfa25d1445093fdb2d9da1f6cfcc"
integrity sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ==
cosmjs-types@^0.8.0:
version "0.8.0"
@ -5721,6 +5716,11 @@ follow-redirects@^1.14.0, follow-redirects@^1.14.9:
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz"
integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==
follow-redirects@^1.15.4:
version "1.15.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020"
integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==
for-each@^0.3.3:
version "0.3.3"
resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz"
@ -6727,18 +6727,6 @@ libsodium-wrappers-sumo@^0.7.11:
dependencies:
libsodium-sumo "^0.7.13"
libsodium-wrappers@^0.7.6:
version "0.7.10"
resolved "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz"
integrity sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==
dependencies:
libsodium "^0.7.0"
libsodium@^0.7.0:
version "0.7.10"
resolved "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz"
integrity sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==
lilconfig@2.0.4:
version "2.0.4"
resolved "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz"
@ -7755,25 +7743,6 @@ protobufjs@^6.10.2, protobufjs@^6.11.2, protobufjs@^6.8.8, protobufjs@~6.11.2:
"@types/node" ">=13.7.0"
long "^4.0.0"
protobufjs@~6.10.2:
version "6.10.2"
resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz"
integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" "^13.7.0"
long "^4.0.0"
proxy-compare@2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/proxy-compare/-/proxy-compare-2.1.0.tgz"
@ -7784,6 +7753,11 @@ proxy-compare@2.5.1:
resolved "https://registry.yarnpkg.com/proxy-compare/-/proxy-compare-2.5.1.tgz#17818e33d1653fbac8c2ec31406bce8a2966f600"
integrity sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==
proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
pump@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"